<?php


namespace Drupal\store\ViewsController\handler\filter;


use Drupal\store\Entity\Store;
use views_handler_filter_in_operator;

class StoreShowListViewsFilter extends views_handler_filter_in_operator {

  function get_value_options() {
    $ss = entity_load('store', FALSE, ['status' => 1]);
    $options = [];
    foreach ($ss as $s) {
      if ($s instanceof Store) {
        $options[$s->id] = "{$s->name} ({$s->id})";
      }
    }
    if (!isset($this->value_options)) {
      $this->value_title = t('状态');
      $this->value_options = $options;
    }
  }
}
